﻿@model IEnumerable<WebUI.Models.QizSubject>
@{
    ViewBag.Title = "我的随访";
    var tm = new QizSubject();
    var Hospitals = (IEnumerable<Hospital>)ViewBag.Hospitals;
    //bool IsContactRended = false;
    bool userCanSubmit = SiteUser.AccountStatus != "102";
    //Dictionary<string, string> idAndNames = new Dictionary<string, string>();    
}
<style type="text/css">
    .tab {
        border-right: #fff 1px solid;
        padding: 0 5px;
        width: 230px;
        line-height: 24px;
        height: 24px;
        display: block;
        text-decoration: none !important;
        text-align: left;
        color: #000 !important;
    }

        .tab:hover {
            color: #ed7018 !important;
        }

    .tab-current {
        background-color: #ed7018;
        color: #fff !important;
    }

        .tab-current:hover {
            color: #fff !important;
        }
</style>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<br />

<table @(userCanSubmit ? "" : "disabled='disabled'") class="width" style="border:none; border-collapse:collapse;">@*;border-bottom:2px solid #ed7018*@
    <tr>
        @foreach (Hospital hospital in Hospitals)
        {
            string id = hospital.HospitalID;//Guid.NewGuid().ToString("N");                
            //idAndNames.Add(id, hospital.HospName);
            <td style="width: 240px; background-color: #f4f4f4; text-align: left; border:none; padding: 0px;">
                <a href="javascript:void(0);" class="tab" onclick="displayPartial(this, '@id');">@hospital.HospName</a>
            </td>
        }
        <td style="background-color: #f4f4f4; border:none;">&nbsp;
        </td>
    </tr>
    <tr>
        <td colspan="@(Hospitals.Count() + 1)" style="border:none;">
            @{
               // var hospitalitem = SiteUser.UserAllRecupers.First().Hospital;
            }
            @*@foreach (var idAndName in idAndNames)            
            {
                
                @Html.Partial("MySfdListPartial", new ViewDataDictionary { 
                    { "HospitalID", idAndName.Key },
                    { "HospitalName", idAndName.Value }, 
                    { "Subjects", Model }, 
                    { "hospitalitem", hospitalitem },
                    { "userCanSubmit", userCanSubmit },
                    { "QizSessions_Of_Recuper", SiteUser.QizSessions_Of_Recuper }
                })
            }*@
            @foreach (Hospital hospital in Hospitals)
            {
                @Html.Partial("MySfdListPartial", new ViewDataDictionary { 
                    { "HospitalID", hospital.HospitalID },
                    { "HospitalName", hospital.HospName }, 
                    { "Subjects", Model }, 
                    { "hospitalitem", hospital },
                    { "userCanSubmit", userCanSubmit },
                    { "QizSessions_Of_Recuper", SiteUser.QizSessions_Of_Recuper }
                })
            }
        </td>
    </tr>
</table>

<script type="text/javascript">
    function displayPartial(el, partialId) {
        if ($(el).hasClass('tab-current')) return;
        $('.tab-current').removeClass('tab-current');
        $(el).addClass('tab-current');
        $('.hospital-home').hide();
        $('#' + partialId).show();
    };
    $(function () {
        $('.cms-group-content').accordion({ heightStyle: "content", collapsible: true, icons: false });
        $('.tab:first').addClass('tab-current');
        $('.hospital-home:first').show();
    });
</script>

@*@Html.Partial("TrHilighter")*@